package cn.edu.scau.cmi.zhangjunjia.factory;

import javafx.fxml.FXML;
import javafx.scene.control.Button;
import cn.edu.scau.cmi.zhangjunjia.factory.*;
import cn.edu.scau.cmi.zhangjunjia.simpleFactoryMethod.MeatFactory;
import cn.edu.scau.cmi.zhangjunjia.simpleFactoryMethod.domain.*; 

import javafx.event.ActionEvent;
import javafx.scene.control.TextArea;

public class FactoryController {

	@FXML
	private TextArea output;
	
	@FXML
	private Button beef;
	
	@FXML
	private Button pork;
	
	MeatFactory meatFactory = null;
	
	@FXML
	public void beefevent(ActionEvent event)
	{
		
		Meat beaf = MeatFactory.getMeat("beef");	
		output.appendText(beaf.cook() + "\n");
	}
	
	@FXML
	public void porkevent(ActionEvent event)
	{
		Meat pork = MeatFactory.getMeat("pork");
		output.appendText(pork.cook() + "\n");
	}
}
